package com.lx.wxdemo.service.impl;

import com.lx.wxdemo.dao.LoginDao;
import com.lx.wxdemo.entity.OpenIdJson;
import com.lx.wxdemo.entity.User;
import com.lx.wxdemo.service.WxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description TODO
 * @Author lx
 * @Date 2021/1/4 16:06
 **/
@Service
public class WxServiceImpl implements WxService {
    @Autowired
    private LoginDao loginDao;

    @Override
    public boolean login(String account, String password) {
        Integer count = loginDao.isLogin(account, password);
        if (count ==1){
            return true;
        }
        return false;
    }

    @Override
    public boolean selectByopenid(String openid) {
        Integer count = loginDao.selectByopenid(openid);
        if (count ==1){
            return true;
        }
        return false;
    }

    @Override
    public void insertUser(User user) {
        loginDao.insertUser(user);
    }
}
